package com.example.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author wuyunbin
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private boolean flag;
    private int code;
    private String msg;
    private Object data;

    public static Result success(Object data){
        return new Result(true,20000,"成功",data);
    }

    public static Result success(){
       return success(null);
    }

    public static Result error(){
        return new Result(false,-1,"失败",null);
    }
}
